<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Users - Admin Template</title>
<link rel="stylesheet" type="text/css" href="<?=base_url();?>css/theme.css" />
<link rel="stylesheet" type="text/css" href="<?=base_url();?>css/style.css" />
</head>

<body>
	<div id="container">

        <div id="wrapper">
            <div id="content">
                <div id="box">
                	<h3>Users</h3>
                	<form action="" method="post" name="search">
                		<input type="text" name="search_text" value="<?=$search_text;?>"/>
                		<input type="hidden" name="order_by" value="<?=$order_by;?>"/>
                		<input type="hidden" name="order_asc" value="<?=$order_asc;?>"/>
                		<input type="submit" name="search_button"/>
                	</form>
                	
                	<a href="<?=site_url('users/form/0');?>">ADD NEWUSER</a>
                	
                	<script type="text/javascript">
                	function formSubmit(order_by)
                	{
                    	oldOrder = document.forms['search'].order_by.value;
                    	
                    	
                    	if(order_by == oldOrder){
                    		//alert(document.forms['ordering'].order_asc.value);
                    		oldAsc = document.forms['search'].order_asc.value;
                    		document.forms['search'].order_asc.value = (oldAsc == "asc")?"desc":"asc";
                    		
                    	}
                    	else{
                    		document.forms['search'].order_asc.value = "asc";
                    	}
                    	
                	  document.forms['search'].order_by.value = order_by;
                	  document.forms['search'].submit();
                	}              	
                	</script>
                	
                	<form action="" method="post" name="ordering">
                		
                	</form>
                	
                	<table width="100%">
						<thead>
							<tr>
                            	<th width="40px"><a href="javascript:formSubmit('uuid');">ID<img src="img/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></a></th>
                            	<th><a href="javascript:formSubmit('name');">Name</a></th>
                                <th><a href="javascript:formSubmit('lastname');">Surname</a></th>
                                <th width="70px"><a href="#">Email</a></th>
                                <th width="50px"><a href="#">Blank</a></th>
                                <th width="90px"><a href="#">Registered</a></th>
                                <th width="60px"><a href="#">Action</a></th>
                            </tr>
						</thead>
						<tbody>
						<?php foreach ($users_list as $user):?>
							<tr>
                            	<td class="a-center"><?=$user['uuid'];?></td>
                            	<td><a href="#"><?=$user['name'];?></a></td>
                                <td><?=$user['lastname'];?></td>
                                <td><?=$user['email'];?></td>
                                <td>1000</td>
                                <td><?=$user['registerdate'];?></td>
                                <td><a href="<?=site_url('users/form/'.$user['uuid']);?>"><img src="img/icons/user.png" title="Show profile" width="16" height="16" /></a>
                                <a href="#"><img src="img/icons/user_edit.png" title="Edit user" width="16" height="16" /></a>
                                <a href="#"><img src="img/icons/user_delete.png" title="Delete user" width="16" height="16" /></a></td>
                            </tr>
                        <?php endforeach;?>
						</tbody>
					</table>
					
                    <div id="pager">
                    	<?php echo $this->pagination->create_links();?>
                    	  | Total <strong><?=$users_total;?></strong> records found
                    </div>
                </div>
                <br />
               
            </div>
            
      </div>
       
</div>
</body>
</html>
